package org.domain;

public class Flight {
	private int totalNumberOfSeats;
	private int numberOfSeatsBooked;
    private String flightDestination;
    private String flightDeparture;
    private String timeOfFlight;
    private String dateOfFlight;
	private int price;
    
    public Flight(String departure, String destination, String flightDate, int totalSeats, int price) {
    	this.flightDeparture = departure;
    	this.flightDestination = destination;
    	this.totalNumberOfSeats = totalSeats;
    	this.numberOfSeatsBooked = 0;
    	this.dateOfFlight = flightDate;
    	setTimeOfFlight();
    	this.price = price;
	}
    public void setTimeOfFlight() {
    	if(flightDeparture == "SFO")
    		this.timeOfFlight = "6:00 AM";
    	if(flightDeparture == "LAS")
    		this.timeOfFlight = "10:00 PM";
	}
        
    //getters
    public int getPrice() {
		return price;
	}
    
    public String getFlightDeparture() {
		return flightDeparture;
	}
    
    public String getFlightDestination() {
		return flightDestination;
	}
    
    public String getDateOfFlight() {
		return dateOfFlight;
	}
    
    public String getTimeOfFlight() {
		return timeOfFlight;
	}
    
    public int getNumberOfSeatsBooked() {
		return numberOfSeatsBooked;
	}
    
    public int getNumberOfSeatsLeft() {
		return totalNumberOfSeats - numberOfSeatsBooked;
	}
    
    public void bookSeat() {
		numberOfSeatsBooked++;
	}
}
